From 36a1b69a19358b852ad28092e1d6a67235de66e3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Sat, 17 Aug 2019 16:12:57 +0200 Subject: [PATCH] cssanimatedstyle: Remove some casts in hot paths gtk_css_animated_style_create_css_transitions down from 16% to 11% when repeatedly clicking on a spinbutton button in the widget factory. --- gtk/gtkcssanimatedstyle.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gtk/gtkcssanimatedstyle.c b/gtk/gtkcssanimatedstyle.c index c09ddb01ce..2b75451840 100644 --- a/gtk/gtkcssanimatedstyle.c +++ b/gtk/gtkcssanimatedstyle.c @@ -195,17 +195,17 @@ transition_info_add (TransitionInfo infos[GTK_CSS_PROPERTY_N_PROPERTIES], { GtkCssStyleProperty *prop = _gtk_css_shorthand_property_get_subproperty (shorthand, i); - transition_info_add (infos, GTK_STYLE_PROPERTY (prop), index); + transition_info_add (infos, (GtkStyleProperty *)prop, index); } } else { guint id; - if (!_gtk_css_style_property_is_animated (GTK_CSS_STYLE_PROPERTY (property))) + if (!_gtk_css_style_property_is_animated ((GtkCssStyleProperty *) property)) return; - id = _gtk_css_style_property_get_id (GTK_CSS_STYLE_PROPERTY (property)); + id = _gtk_css_style_property_get_id ((GtkCssStyleProperty *) property); g_assert (id < GTK_CSS_PROPERTY_N_PROPERTIES); infos[id].index = index; infos[id].pending = TRUE; @@ -231,7 +231,7 @@ transition_infos_set (TransitionInfo infos[GTK_CSS_PROPERTY_N_PROPERTIES], for (j = 0; j < len; j++) { - property = GTK_STYLE_PROPERTY (_gtk_css_style_property_lookup_by_id (j)); + property = (GtkStyleProperty *)_gtk_css_style_property_lookup_by_id (j); transition_info_add (infos, property, i); } } -- 2.30.2